<template>
  <div>
 <div>姓名：{{ name }}</div>
<div>年龄：{{ age }}</div>
<div>地址：{{ address }}</div>
<button @click="changeName">改变姓名</button>
<button @click="changeAge">年龄+1</button>
<button @click="showTel">展示电话</button>
  </div>
</template>
<script setup lang="ts" name="Person444">
import { onMounted, getCurrentInstance } from 'vue';

onMounted(() => {
  const instance = getCurrentInstance();
  console.log(instance?.type.name); // 输出组件名（需 Vue 3.3+）
});
import { ref } from 'vue'
let name = ref('张三')
   let age = ref(18)
   let tel=ref('123456789')
   let address=ref("银河")
   function changeName(){
     name.value = '李四'
   }
   function changeAge(){
     age.value +=1
   }
   function showTel(){
     alert(tel.value)
   }
</script>

<style>

</style>